import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/upload_voice_entity.dart';

UploadVoiceEntity $UploadVoiceEntityFromJson(Map<String, dynamic> json) {
  final UploadVoiceEntity uploadVoiceEntity = UploadVoiceEntity();
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    uploadVoiceEntity.msg = msg;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    uploadVoiceEntity.code = code;
  }
  final UploadVoiceData? data = jsonConvert.convert<UploadVoiceData>(
      json['data']);
  if (data != null) {
    uploadVoiceEntity.data = data;
  }
  return uploadVoiceEntity;
}

Map<String, dynamic> $UploadVoiceEntityToJson(UploadVoiceEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['msg'] = entity.msg;
  data['code'] = entity.code;
  data['data'] = entity.data?.toJson();
  return data;
}

extension UploadVoiceEntityExtension on UploadVoiceEntity {
  UploadVoiceEntity copyWith({
    String? msg,
    int? code,
    UploadVoiceData? data,
  }) {
    return UploadVoiceEntity()
      ..msg = msg ?? this.msg
      ..code = code ?? this.code
      ..data = data ?? this.data;
  }
}

UploadVoiceData $UploadVoiceDataFromJson(Map<String, dynamic> json) {
  final UploadVoiceData uploadVoiceData = UploadVoiceData();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    uploadVoiceData.createTime = createTime;
  }
  final UploadVoiceDataParams? params = jsonConvert.convert<
      UploadVoiceDataParams>(json['params']);
  if (params != null) {
    uploadVoiceData.params = params;
  }
  final String? lang = jsonConvert.convert<String>(json['lang']);
  if (lang != null) {
    uploadVoiceData.lang = lang;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    uploadVoiceData.id = id;
  }
  final int? deviceId = jsonConvert.convert<int>(json['deviceId']);
  if (deviceId != null) {
    uploadVoiceData.deviceId = deviceId;
  }
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    uploadVoiceData.userId = userId;
  }
  final int? voiceType = jsonConvert.convert<int>(json['voiceType']);
  if (voiceType != null) {
    uploadVoiceData.voiceType = voiceType;
  }
  final int? aiPlatform = jsonConvert.convert<int>(json['aiPlatform']);
  if (aiPlatform != null) {
    uploadVoiceData.aiPlatform = aiPlatform;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    uploadVoiceData.status = status;
  }
  return uploadVoiceData;
}

Map<String, dynamic> $UploadVoiceDataToJson(UploadVoiceData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['params'] = entity.params?.toJson();
  data['lang'] = entity.lang;
  data['id'] = entity.id;
  data['deviceId'] = entity.deviceId;
  data['userId'] = entity.userId;
  data['voiceType'] = entity.voiceType;
  data['aiPlatform'] = entity.aiPlatform;
  data['status'] = entity.status;
  return data;
}

extension UploadVoiceDataExtension on UploadVoiceData {
  UploadVoiceData copyWith({
    String? createTime,
    UploadVoiceDataParams? params,
    String? lang,
    int? id,
    int? deviceId,
    int? userId,
    int? voiceType,
    int? aiPlatform,
    int? status,
  }) {
    return UploadVoiceData()
      ..createTime = createTime ?? this.createTime
      ..params = params ?? this.params
      ..lang = lang ?? this.lang
      ..id = id ?? this.id
      ..deviceId = deviceId ?? this.deviceId
      ..userId = userId ?? this.userId
      ..voiceType = voiceType ?? this.voiceType
      ..aiPlatform = aiPlatform ?? this.aiPlatform
      ..status = status ?? this.status;
  }
}

UploadVoiceDataParams $UploadVoiceDataParamsFromJson(
    Map<String, dynamic> json) {
  final UploadVoiceDataParams uploadVoiceDataParams = UploadVoiceDataParams();
  return uploadVoiceDataParams;
}

Map<String, dynamic> $UploadVoiceDataParamsToJson(
    UploadVoiceDataParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension UploadVoiceDataParamsExtension on UploadVoiceDataParams {
}